﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Shop.Image.Kit
{
    public class ImgEntity
    {
        string _imgFullName="";
        string _imgName="";
        string _imgUrl="";
        int _imgWidth=0;
        int _imgHeight=0;

        public string ImgFullName
        {
            get { return _imgFullName; }
            set { _imgFullName = value; }
        }

        public string ImgName
        {
            get { return _imgName; }
            set { _imgName = value; }
        }

        public string ImgUrl
        {
            get { return _imgUrl; }
            set { _imgUrl = value; }
        }

        public int ImgWidth
        {
            get { return _imgWidth; }
            set { _imgWidth = value; }
        }

        public int ImgHeight
        {
            get { return _imgHeight; }
            set { _imgHeight = value; }
        }

        /// <summary>
        /// 返回重命名后的图片名称
        /// </summary>
        /// <param name="index">图片命名的序号,以在整个页面的位置为序</param>
        /// <param name="kind">图片的类型,如.jpg, .png, .gif</param>
        /// <returns></returns>
        public static string RenameImg(int index, string kind)
        {
            string imgName = "";
            if (index < 10)
            {
                imgName = "00" + index.ToString() + kind;
            }
            else
            {
                imgName = "0" + index.ToString() + kind;
            }
            return imgName;
        }
    }
}
